accountingIntegrationDashboardApp.controller('maintenanceGlElementValueCtrl', ['$scope', '$http', '$log', 'serverDataService', function ($scope, $http, $log, serverDataService){ 

    $scope.glElements = [];
    $scope.entityName = 'gl-element-value';

    $scope.setChildScope($scope);

    $scope.renderRecordsFromServer();

    $scope.loadGlElements = function(){
        return $scope.glElements.length ? null : serverDataService.getEntityList('gl-element', false)
                .then(function (data){
                    $scope.glElements = data.gridRecords;
                });
    };

    $scope.addGlElementValue = function() {
        $scope.inserted = {
          id: null,
          elementValue: null
        };
        $scope.gridRecords.push($scope.inserted);
    };
}]);